<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- 复选框多个一起使用：选择数组收集用户选择的内容，收集的是当前input的value值 -->
        <h2>选择你最喜欢的水果</h2>
        <input type="checkbox" value="榴莲" v-model="likeFruit" />榴莲
        <input type="checkbox" value="葡萄" v-model="likeFruit" />葡萄
        <input type="checkbox" value="哈密瓜" v-model="likeFruit" />哈密瓜
        <input type="checkbox" value="西瓜" v-model="likeFruit" />西瓜


    </div>
    <script>
        Vue.config.productionTip = false;

        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    likeFruit: [],
                }
            }
        })
    </script>
</body>

</html>